package cn.bdqn.activity03;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class TwoActivity extends AppCompatActivity {
    private Button btnTwo;
    private TextView tvTwo;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_two);
        btnTwo=findViewById(R.id.btn_one);
        tvTwo=findViewById(R.id.tv_two);
        tvTwo.setText(this.toString());
        Toast.makeText(this,"three",Toast.LENGTH_SHORT).show();
        btnTwo.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(TwoActivity.this,ThreeActivity.class);
                startActivity(intent);
            }
        });
    }
}
